home *** CD-ROM | disk | FTP | other *** search
- Path: erich.triumf.ca!bennett
- From: bennett@erich.triumf.ca (P.Bennett)
- Newsgroups: comp.lang.c
- Subject: Re: File problem with Watcom C/C++ 10.5
- Date: 7 Apr 1996 21:15 PST
- Organization: TRIUMF: Tri-University Meson Facility
- Distribution: world
- Message-ID: <7APR199621150113@erich.triumf.ca>
- References: <4k9fds$4fs@sparcserver.lrz-muenchen.de>
- NNTP-Posting-Host: erich.triumf.ca
- News-Software: VAX/VMS VNEWS 1.50
-
- In article <4k9fds$4fs@sparcserver.lrz-muenchen.de>, Ralph Reichart <reichart@informatik.tu-muenchen.de> writes...
- >hi,
- >
- >i have a big problem. i'm trying to open a file with fopen. the program
- >looks like this:
- ...
- >
- > Datei = fopen("\autoexec.bat", "r");
-
- remember that '\' is a special character in C strings (it and the following
- char make a non-printing char). '\a' happens to produce the Bell char, which
- is not a valid char in a filename. To actually put a '\' in a string, you need
- to use two, thus: '\\', so you need to say:
- Datei = fopen("\\autoexec.bat","r");
- Or, since it is really only DOS's command line that requires the '\', you can
- say:
- Datei = fopen"/autoexec.bat","r");
-
-
- Peter Bennett VE7CEI | Vessels shall be deemed to be in sight
- Internet: bennett@triumf.ca | of one another only when one can be
- Packet: ve7cei@ve7kit.#vanc.bc.ca | observed visually from the other
- TRIUMF, Vancouver, B.C., Canada | ColRegs 3(k)
- GPS and NMEA info and programs: ftp://sundae.triumf.ca/pub/peter/index.html
- or: ftp://ftp-i2.informatik.rwth-aachen.de/pub/arnd/GPS/peter/index.html
-
-
-
-
-